Function Index
Date/Time Functions
date(year, month, day)
Returns a date serial number.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
=date(2009,10,10) returns 40096
=date(1899,12,30) returns 0
=date(100,1,1) returns -657434
=date(1800,1,1) - time(1,1,1) returns 36522.0423726852 (1/1/1800 1:01)
dateDiff(startDateString, endDateString)
Returns a period string representing the difference between two dates.
The date parameters must be specified as generic date/time strings.
A generic date/time/period string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
P1Y2M3DT10H30M50S.000 (which means a period of: 1 year, 2 months, 3 days, 10 hours, 30 minutes, 50 seconds, 0 milliseconds)
-P120D (which means a period of minus 120 days)
PT63H (which means 63 hours)
=dateDiff("2005-01-01", "2005-12-31") returns "P364D"
=dateDiff("2005-01-01T18:15:10", "2005-01-04T12:10:00") returns "P2DT17H50M50S"
=dateDiff(dateText(2005, 1, 1), dateText(2005, 12, 31)) returns "P364D"
dateText(year, month, day)
Returns a generic date string representing a given date.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=dateText(2010, 7, 15) returns "2010-07-15"
dateValue(text)
Converts formatted date/time text to a date serial number string. If the text does't contain the date year, the current year will be used.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
=dateValue("8/11/2005") returns 38575
=dateValue("Apr-15") returns 39918
=dateValue("Sep, 2008") returns 40422
day(dateNumber) / day(dateString)
Returns an integer <1, 31> representing the day of the month of a given date.
The date parameter can be specified either as a date serial number or as a generic date/time/period string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=day(date(2010,2,9)) returns 9
=day(dateValue("Apr-15")) returns 15
=day("2010-02-09") returns 9
eDate(dateNumber, n) / eDate(dateString, period)
The date parameter can be specified either as a date serial number or as a generic date/time/period string.
The first version returns a date serial number representing a date n months after (n>0) or before (n<0) a given date. The second version returns a generic date/time string representing a date after or before – depending on the period – a given date.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time/period string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=eDate(date(2005,2,15), 4) returns 38518
=eDate(38382, 1) returns 38411
=eDate("2005-01-01", "P2D") returns "2005-01-03"
=eDate("2005-02-01", "P30D") returns "2005-03-03"
=eDate("2005-03-03", "-P30D") returns "2005-02-01"
=eDate("13:34:22.33", "PT1H7M") returns "14:41:22.330"
=eDate("2005-08-10T15:27:36.10", "P10DT3H7M12.95S") returns "2005-08-20T18:34:49.050"
eoMonth(dateNumber, n) / eoMonth(dateString, period)
The date parameter can be specified either as a date serial number or as a generic date/time/period string.
The first version returns a date serial number representing a date of the last day of the month n months after (n>0) or before (n<0) a given date. The second version returns a generic date/time string representing a date of the last day of the month after or before a given period.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time/period string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=eoMonth(date(2005,1,1), 1) returns 38411
=eoMonth(date(2010,1,1), -1) returns 40178
=eoMonth("2005-01-01", "-P1M") returns "2004-12-31"
=eoMonth("2010-01-01", "-P250D") returns "2009-04-30"
hour(timeNumber) / hour(timeString)
Returns an integer <0, 23> representing the hour of the time.
The time parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=hour(time(12,59,11)) returns 12
=hour(date(2010,8,8) + time(20,0,1.01)) returns 20
=hour("12:59:11") returns 12
=hour("2010-08-08T20:00:01.01") returns 20
minute(timeNumber) / minute(timeString)
Returns an integer <0, 59> representing the minute of the time.
The time parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=minute(time(12,59,11)) returns 59
=minute(date(2010,8,8) + time(20,0,1.01)) returns 0
=minute("12:59:11") returns 59
=minute("2005-08-08T20:00:01.01") returns 0
month(dateNumber) / month(dateString)
Returns an integer <1, 12> representing the month of a given date.
The date parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=month(date(2010,1,1)) returns 1
=month("2005-01-01") returns 1
networkDays(startDateNumber1, endDateNumber2, [offDates]) networkDays2(startDateString1, endDateString2, offDates)
Returns the number of working days between two dates (inclusive) excluding weekends and dates specified in the offDates array.
The date parameters can be specified either as date serial numbers or as generic date/time strings.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=networkDays(date(2010,1,1), date(2010,1,31),) returns 21
=networkDays(date(2010,1,1), date(2010,1,31), {40190, 40197}) returns 19
=networkDays("2010-01-01", "2010-01-31",) returns 21
=networkDays("2010-01-01", "2010-01-31", {"2010-01-12", "2010-01-19"}) returns 19
NETWORKDAYS.INTL(startDateNumber1, endDateNumber2, [weekend], [holidays])
The weekend argument defines which days of the week are treated as weekend days. It can be either:
- a numeric code (1–17), or
- a 7‑character string of 0/1 flags (Monday→Sunday), where 1 marks a weekend day.
If weekend is omitted, the default weekend is Saturday–Sunday.
If holidays is omitted, no holiday dates are excluded.
Examples:
NETWORKDAYS.INTL("2025-01-01", "2025-01-31") returns the number of business days in January 2025 (Sat–Sun weekend).
NETWORKDAYS.INTL("2025-01-01", "2025-01-31", "0000011") treats Friday–Saturday as weekend.
NETWORKDAYS.INTL("2025-01-01", "2025-01-31", 7, { "2025-01-06", "2025-01-15" }) excludes two holiday dates.
now()
Returns the current date and time as a date/time serial number.
=now() returns 40116.6196296296
nowText()
Returns the current date and time as a generic date/time string.
=nowText() returns "2009-10-30T14:52:16"
second(timeNumber) / second(timeString)
Returns an integer <0, 59> representing the second of the time value.
The time parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=second(time(12,59,11)) returns 11
=second(date(2010,8,8) + time(20,0,1.01)) returns 1
=second("12:59:11") returns 11
=second("2010-08-08T20:00:01.01") returns 1
time(hour, minute, second)
Returns a date/time serial number representing a given time.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
=time(16, 20, 15) returns 0.68072916667006
timeText(hour, minute, second)
Returns a generic time string representing a given time.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=timeText(16, 20, 15) returns "16:20:15"
timeValue(text)
Converts formatted date/time text to a time serial number.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
=timeValue("6:24 PM") returns 0.76666666667006
today()
Returns a date serial number representing the current date.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
=today() returns 40055
todayText()
Returns a generic date string representing the current date.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=todayText() returns "2009-08-30"
weekDay(dateNumber, [numbering]) / weekDay(dateString, [numbering])
Returns the day of the week for a given date. The numbering argument specifies which day numbering variant should be used:
1 - Sunday=1,...,Saturday=7
2 - Monday=1,...,Sunday=7
3 - Monday=0,...,Sunday=6.
If numbering is omitted, it's assumed to be 1.
The date parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=weekDay(date(2010,1,1),) returns 6
=weekDay("2010-01-01",) returns 6
weekNum(dateNumber, [numbering]) / weekNum(dateString, [numbering])
Returns the number of the week for a given date. The numbering argument specifies on what day the week should begins:
1 - on Sunday
2 - on Monday.
If numbering is omitted, it's assumed to be 1.
The date parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=weekNum(date(2010,1,21),) returns 4
=weekNum("2010-01-21",) returns 4
workDay(dateNumber, n, [offDateList]) / workDay(dateString, n, [offDateList])
The date parameters can be specified either as date/time serial numbers or as generic date/time strings.
The first version returns a date serial number representing a date n working days before (n<0) or after (n>0) a given day excluding weekends. The optional offDates array contains additional dates that should be excluded. All arguments must be in the form of date/time serial numbers.
The second version returns a generic date/time string and all the input dates must be generic date/time strings.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=workDay(date(2010,1,1), 21,) returns 40210
=workDay(date(2010,1,1), 19, {40190, 40197}) returns 40210
=workDay("2010-01-01", 21,) returns "2010-02-01"
=workDay("2010-01-01", 19, {"2010-01-12", "2010-01-19"}) returns "2010-02-01"
WORKDAY.INTL(start_date, days, [weekend], [holidays])
The weekend argument defines which days of the week are treated as weekend days. It can be either:
- a numeric code (1–17), or
- a 7‑character string of 0/1 flags (Monday→Sunday), where 1 marks a weekend day.
If days is positive, the result is a future working date. If days is negative, the result is a past working date.
If weekend is omitted, the default weekend is Saturday–Sunday.
If holidays is omitted, no holiday dates are excluded.
Examples:
WORKDAY.INTL("2025-01-01", 10) returns the date 10 workdays after Jan 1 (Sat–Sun weekend).
WORKDAY.INTL("2025-01-01", 10, "0000011") treats Friday–Saturday as weekend.
WORKDAY.INTL("2025-01-01", -5, 1, { "2025-01-06" }) returns the date 5 workdays before Jan 1, excluding a holiday.
year(dateNumber) / year(dateString)
Returns an integer <100, 9999> representing the year of a given date.
The date parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=year(date(2010,1,1)) returns 2010
=year(date(9999,1,1) + time(15,10,00)) returns 9999
=year("2010-01-01") returns 2010
=year("40000-01-01T15:10:00") returns 40000
yearDay(dateNumber) / yearDay(dateString)
Returns the year day number for a given date.
The date parameter can be specified either as a date/time serial number or as a generic date/time string.
A date/time serial number is a floating point value representing a date between January 1, 100 and December 31, 9999. The integer part of that value represents days and the fractional part represents the time of the day. The value 1.0 represents December 31, 1899. Negative numbers represent dates prior to December 30, 1899.
A generic date/time string is a string that conforms to the www.w3.org specification for date/time/period data types, for example:
2006-01-31
2006-01-31T13:10:55
2006-01-31T13:10:55.123
2006-01-31T23:30:00+02:00
13:10:00
13:10:55.123
13:10:55-00:30
=yearDay(date(2010,1,1)) returns 1
=yearDay(date(9999,1,1) + time(15,10,00)) returns 1
=yearDay("2010-07-04") returns 185